﻿<UserControl x:Class="Wizard.WizardControl.Views.MultiOptionGroupView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <Grid>
        <GroupBox Header="{Binding Path=DisplayName}"
                  Padding="2">
            <ItemsControl ItemsSource="{Binding Path=OptionModels}">
                <ItemsControl.ItemTemplate>
                    <!--Mostly copied from OptionGroupView-->
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox Margin="2,0,0,0"
                                      IsChecked="{Binding Path=IsSelected}" />
                            <Label Margin="0,-6,0,0"
                                   Target="{Binding RelativeSource={RelativeSource AncestorType=StackPanel}, Path=Children[0]}">
                                <AccessText Text="{Binding Path=DisplayName, StringFormat=_{0}}"
                                            ToolTip="{Binding Path=ToolTip}" />
                            </Label>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </GroupBox>
    </Grid>
</UserControl>
